package com.example.mapp;

import com.example.entity.authority.SysUserRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by youkun on 2017/8/13.
 */
@Mapper
public interface SysUserRoleMapp {

    @Delete(" delete from sys_user_role where role_id=#{id}")
    public int deleteByRoleId(String id) throws Exception;

    @Delete(" delete from sys_user_role where user_id=#{id}")
    public int deleteByUserId(String id) throws Exception;

    @Select(" select id,role_id,user_id from sys_user_role where role_id=#{id}")
    public SysUserRole queryByRoleId(String id) throws Exception;

    @Select(" select id,role_id,user_id from sys_user_role where user_id=#{id}")
    public SysUserRole queryByUserId(String id) throws Exception;

    @Insert(" insert into sys_user_role (role_id,user_id) value (#{roleId},#{userId})")
    public int insert(SysUserRole sysUserRole) throws Exception;


}
